 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="lib/html5shiv.js"></script>
    <script type="text/javascript" src="lib/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css" />
    <!--[if IE 6]>
    <script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title>冰排当前状态列表</title>
    <link rel="stylesheet" href="lib/zTree/v3/css/zTreeStyle/zTreeStyle.css" type="text/css">
    <link rel="stylesheet" type="text/css" href="lib/print/print.min.css">
</head>
<style>
    .table>tbody>tr>td{
        text-align:center;
    }
</style>

<body class="pos-r">
<%--<div class="pos-a" style="width:200px;left:0;top:0; bottom:0; height:100%; border-right:1px solid #e5e5e5; background-color:#f5f5f5; overflow:auto;">--%>
    <%--<ul style="margin-top: 15px;margin-left: 20px"><i class="Hui-iconfont Hui-iconfont-fenlei"></i> 设备排期</ul>--%>
    <%--<ul id="treeDemo" style="margin-left: 10px" class="ztree"></ul>--%>
<%--</div>--%>
<div style="">
    <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 报表 <span class="c-gray en">&gt;</span> <span id="category">冰排当前状态</span> <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
    <form id="form-search" class="page-container">
<%--        <div class="cl pd-5 bg-1 bk-gray mt-20">--%>
<%--            <span class="l">--%>
<%--                <a href="javascript:;" onclick="print()" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe652;</i> 批量打印</a>--%>
<%--                <a class="btn btn-primary radius" onclick="device_add('添加设备','device-add')" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 添加设备</a>--%>
<%--                <a class="btn btn-primary radius" onclick="downloadExcel()" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 导出所有设备</a>--%>
<%--            </span>--%>
<%--        </div>--%>
        <div class="mt-20">
            <div class="mt-20" style="margin-bottom: 70px">
                <table class="table table-border table-bordered table-bg table-hover table-sort" width="100%">
                    <thead>
                    <tr class="text-c">
                        <th width="40">编号</th>
                        <th width="40">类型</th>
                        <th width="60">属性</th>
                        <th width="80">最近入库时间</th>
                        <th width="60">最近出库时间</th>
                        <th width="50">冷冻时长</th>
                        <th width="90">处理方式</th>
                        <th width="90">冰包编码</th>
                        <th width="90">状态</th>
                        <th width="90">处理方式</th>
                    </tr>
                    </thead>
                </table>
            </div>
        </div>
    </form>
</div>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
<%--<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>--%>
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="lib/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript" src="lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="lib/datatables/dataTables.colReorder.min.js"></script>
<script type="text/javascript" src="lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="lib/common.js"></script>

<script type="text/javascript">
    var typeObject = {
        "BBP":"白冰排",
        "LBP":"蓝冰排",
    }

    /*datatables配置*/
       var table =  $('.table').DataTable({
            serverSide: true,//开启服务器模式
            "processing": true,//加载显示提示
            "ajax": {
                url:"./report/ice/now",
                type: 'GET',
                data:{
                    "searchKey": "",
                },
            },
            "columns": [

                { "data": "code"},
                { "data": "type",
                    render : function(data,type, row, meta) {
                        return data +"("+typeObject[data]+")";
                    }
                    },
                { "data": "prov"},
                { "data": "inTime",
                    render : function(data,type, row, meta) {
                        return date(data);
                    }
                },
                { "data": "outTime",
                    render : function(data,type, row, meta) {
                        return date(data);
                    }
                },
                { "data": "freezingTime"},

                { "data": "handleType"},

                { "data": "boxCode"},

                { "data": "state",
                    render : function(data,type, row, meta) {
                        if(data==0){
                            return "<span class=\"label label-defant radius td-status\">不可用</span>";
                        }else if(data==1){
                            return "<span class=\"label label-success radius td-status\">可用</span>";
                        }else if(data ==2){
                            return "<span class=\"label label-warning radius td-status\">正在使用</span>";
                        }else {
                            return "<span class=\"label label-defant radius td-status\">无任何记录</span>";
                        }
                    }
                },
                { "data": "adminManager"},
            ],
            "aaSorting": [[ 0, "asc" ]],//默认第几个排序
            "bStateSave": false,//状态保存
            "aoColumnDefs": [
                {"orderable":false,"aTargets":[2,3,4,5,6,7,8,9]}// 制定列不参与排序
            ],
            language: {
                url: './lib/datatables/Chinese.json'
            },
            colReorder: true
        });


    /*初始化类别数据*/
    var cid=-1;
    /*多条件查询*/
    $("#form-search").validate({
        rules:{
            minDate:{
                required:true,
            },
            maxDate:{
                required:true,
            },
            searchKey:{
                required:false,
            },
        },
        onkeyup:false,
        focusCleanup:false,
        success:"valid",
        submitHandler:function(form){
            var searchKey= $('#searchKey').val();
            var minDate= $('#minDate').val();
            var maxDate= $('#maxDate').val();
            var param = {
                "searchKey": searchKey,
                "minDate": minDate,
                "maxDate":maxDate
            };
            var table = $('.table').DataTable();
            table.settings()[0].ajax.data = param;
            table.ajax.url( './report/ice/now' ).load();
        }
    });

</script>

</body>
</html>
